#pragma once
class CChipGroup;

class CGroupManager
{
	vector<CChipGroup> m_vGrouplist;
	int LUT_GRPNUMofCHIPS[96];
	int m_nCntUser;

public:
	CGroupManager(void);
	~CGroupManager(void);
	void initialize(void);
	void makeGroup(int chpindex);
	void renewLUT(unsigned int startgrpindex);
	void setCntUser(int cntUser);
	
	bool groupManage(RESULTPACKET result, jint roomId);
	bool isAdjacent(int group1, int group2);
	bool canMakeAsset(PLAYER userSlot);
	void adjustChip(RESULTPACKET result, vector<int>* pvGrpindex_notowned, vector<int>* pvChpindex_owned);
	vector<int> adjustGroup(int startchip, vector<int> vChpindex_owned);
	bool mergeChipToAsset(vector<int> notowned, RESULTPACKET result);
	bool friendlyMerge(vector<int> vGrpindex_owned);
	bool hostileMerge(vector<int> vGrpindex_owned);
};

